using System;
using System.Collections.Generic;
using System.Web;
using System.Data;
using System.Configuration;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using System.Data.SqlClient;
using System.Collections;

/// <summary>
/// Summary description for Validar
/// </summary>
public class Validar
{
    public Validar()
    {
        //
        // TODO: Add constructor logic here
        //
    }

    public static bool validarFecha(string fecha)
    {

        
        int dia = int.Parse(fecha.Substring(0, 2));
        int mes = int.Parse(fecha.Substring(3, 2));
        int anio = int.Parse(fecha.Substring(6, 4));
        try
        {
            DateTime date = new DateTime(anio, mes, dia);
            return true;
        }
        catch (ArgumentOutOfRangeException)
        {
            return false;
        }

    }
}
